import Vue from 'vue'
import App from './App.vue'
import router from './router'

import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
import codeBlock from '@/components/code.vue'
/**
 * 自定义指令
 */
//引入样式
import 'highlight.js/styles/monokai-sublime.css'
//引入库
import hi from 'highlight.js'
//创建指令
Vue.directive('highlight', function (el) {
  let blocks = el.querySelectorAll('pre code');
  // console.log(blocks, "blocks");
  blocks.forEach((block) => {
    hi.highlightAll(block)
  })
})


Vue.config.productionTip = false
Vue.use(ElementUI);
Vue.component('codeBlock', codeBlock)

new Vue({
  router,
  render: h => h(App)
}).$mount('#app')
